package common.exceptions;


/**
 * Thrown when trying to add an entity to the DB with a key that already exists
 * 
 * @author Gal Lalouche
 */
public class ExistingEntityException extends RuntimeException {
	
	/**
	 * @param entity The username that already existed
	 */
	public ExistingEntityException(Object entity) {
		super("Entity already exists with requested id: " + entity);
		if (entity == null) {
			throw new IllegalArgumentException("entity is null");
		}
	}
	
}
